<template>
  <div>
    <el-row class="tac">
      <el-col class="tac-main" :span="12">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo tac-border"
          @open="handleOpen"
          @close="handleClose"
        >
        <!-- 超管特有功能  开始 -->
          <el-submenu index="1" v-if="isSuperAdmin">
            <template slot="title">
              <i class="el-icon-user"></i>
              <span>人 员 管 理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="1-1"><router-link to="/admin/index/AdminList">人员列表</router-link></el-menu-item>
              <el-menu-item class="liWidth" index="1-2"><router-link to="/admin/index/AddAdmin">人员添加</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 超管特有功能  结束 -->
          <!-- 车辆信息 -->
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-odometer"></i>
              <span>车 辆 信 息</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="2-1"><router-link to="/admin/index/carlist">车辆列表</router-link></el-menu-item>
              <el-menu-item class="liWidth" index="2-2"><router-link to="/admin/index/carcheck">车辆审核</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 出租方 -->
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-custom"></i>
              <span>出租方管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="3-1"><router-link to="/admin/index/lessorsUser">出租方列表</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 租赁方 -->
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-user-solid"></i>
              <span>租赁方管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="4-1"><router-link to="/admin/index/hireList">租赁方列表</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 用户身份审核 -->
          <el-submenu index="5">
            <template slot="title">
              <i class="el-icon-view"></i>
              <span>身 份 审 核</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="5-1"><router-link to="/admin/index/audit">身份审核</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 订单 -->
          <el-submenu index="6">
            <template slot="title">
              <i class="el-icon-s-ticket"></i>
              <span>订 单 管 理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="6-1"><router-link to="/admin/index/order">订单列表</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 评价 -->
          <el-submenu index="7">
            <template slot="title">
              <i class="el-icon-edit-outline"></i>
              <span>评 价 管 理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item class="liWidth" index="7-1"><router-link to="/admin/index/estimate">评价列表</router-link></el-menu-item>
              <el-menu-item class="liWidth" index="7-2"><router-link to="/admin/index/estimateChart">图表统计</router-link></el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data(){
    return {
      isSuperAdmin:false,
    }
  },
  created(){
    //初始化isSuperAdmin属性
    this.isSuperAdmin = JSON.parse(localStorage.adminState);
  },
  methods: {
    handleOpen(key, keyPath) {
      // console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      // console.log(key, keyPath);
    },
  }
};
</script>

<style scoped>
*{
    box-sizing: border-box;
}
a{
  text-decoration: none;
  color: black;
  display: block;
  width: 100%;
  height: 100%;
}
.el-menu-item-group__title{
  padding-left: 0;
}
.el-table th,
.el-table td {
  text-align: center !important;
}
.el-main {
  line-height: normal !important;
}
.tac{
    border: none;
    width: 100%;
}
.tac-main {
  width: 100%;
  border: none;
}
.tac-border{  
    border: none;
    width: 100%;
}
.liWidth{
  padding: 0px;
}
</style>